package ltd.followkba.page;

import android.app.ActivityManager;
import android.content.Context;

import java.util.HashMap;
import java.util.List;

import ltd.advskin.MRAM;
import ltd.advskin.base.BasePage;
import ltd.followkba.MAPP;
import ltd.followkba.R;
import main.MAPI;

import static ltd.advskin.MSKIN.MSTRING;

public class LogcatPage extends BasePage {
     private HashMap<String, Integer> mHashMap;

    // 所有的页面都接受同样的方式打开LOG
    public static boolean logEnable;

    public void MLOG(String text) {
        if (logEnable) {
            MSTRING(MAPI.GET_LOG_NAME(this) + text);
        }
    }

    @Override
    public void onInitView() {                       // 使用者需要继承，初始化页面控件等显示
        setLayout(R.layout.page_logcat);


    }

    @Override
    public void onInitData(){                                                                       // onInitView结束，开始加载数据
    }

    private HashMap<String, Integer> getProcessNames(Context context) {
        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        List<ActivityManager.RunningAppProcessInfo> tasks = am.getRunningAppProcesses();
//
//        am.getRunningAppProcesses()
//
//        Object activityManager = MRAM.mContext.getSystemService(Context.ACTIVITY_SERVICE);
//        for (processInfo in activityManager.runningAppProcesses){
//            if(processInfo.processName.contains(context.packageName)) {
//                map[processInfo.processName] = processInfo.pid
//            }
//        }
        return null;
    }

}
